<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="../js/jquery-3.4.1.min.js"></script>
		<script>
			$(function(){
				//$("div").text("大扎好，我是");
				var d=$("div");
				//for(var i=0;i<d.length;i++){}
				//d.each();
				var h=$("h2")[0];//get(0)
				
				h.innerHTML="这就是一个h2";
				
				$.each(d,function(j,e){//j是下标，e是dom元素
					e.innerHTML="这是第"+(j+1)+"个div";
					$(e).html("<h1>"+"这是第"+(j+1)+"个div"+"</h1>");
				});
			});
		</script>
	</head>
	<body>
		<h2>xxx</h2>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
	</body>
</html>
